/*
 * @Author: moeWang
 * @Date: 2022-03-09 14:36:10
 * @LastEditTime: 2022-03-09 14:47:46
 * @LastEditors: moeWang
 * @Description:
 * @FilePath: \nest-web\src\logical\org\entity\org.entity.ts
 */

import { ApiPropertyOptional } from '@nestjs/swagger';
import {
  Column,
  Comment,
  Model,
  PrimaryKey,
  Table,
} from 'sequelize-typescript';
import { DataTypes } from 'sequelize';

@Table({
  tableName: 'rp_org',
  timestamps: false,
})
export class RpOrgEntity extends Model<RpOrgEntity> {
  @ApiPropertyOptional({ description: '主键' })
  @Comment('id')
  @PrimaryKey
  @Column({
    type: DataTypes.BIGINT,
    field: 'org_id',
  })
  orgId: string;

  @ApiPropertyOptional({ description: '' })
  @Column({
    type: DataTypes.CHAR,
  })
  label: string;

  @ApiPropertyOptional({ description: '' })
  @Column({
    type: DataTypes.INTEGER,
    field: 'org_type',
  })
  orgType: number;

  @ApiPropertyOptional({ description: '' })
  @Column({
    type: DataTypes.INTEGER,
  })
  sort: number;

  @ApiPropertyOptional({ description: '上级组织id' })
  @Column({
    type: DataTypes.BIGINT,
    field: 'up_org_id',
  })
  upOrgId: string;
}
